import { IArticle } from '@/interface';
import { $get, $post, $put, $delete } from '@/request/api';

export function fetchArticleList(params) {
  return $get('/article/list',params);
}

export function fetchArticleDetail(id: number) {
  return $post( `/article/find/${id}`);
}

export function fetchCreateArticle(data: IArticle) {
  return $put('/article/create',data);
}
export function fetchUpdateArticle(data: IArticle) {
  return $put(`/article/update/${data.id}`,data);
}
export function fetchDeleteArticle(id: number) {
  return $delete( `/article/delete/${id}`);
}
